package com.dingding.web.banner.action;

import java.util.List;

import javax.annotation.Resource;

import com.dingding.common.core.beans.BannerImage;
import com.dingding.facde.banner.service.IBannerShowService;
import com.dingding.web.base.action.BaseAction;

/**
 * @ClassName: BannerImageAction
 * @Description: Banner的Action类
 * @author yuHaiQing
 * @date 2016年3月28日 下午2:52:44
 */
@SuppressWarnings("all")
public class BannerImageAction extends BaseAction {

	@Resource(name="bannerShowService")
	private IBannerShowService bannerShowService;
	
	/**
	 * @Title: getBannerList
	 * @Description: 获取Banner列表
	 * @author yuHaiQing
	 * @return String    响应数据
	 */
	public String getBannerList(){
		
		//显示类型(1:商城显示  2:app主页显示)
		Integer bannerShowType = null;
		//图片类型(1:小图  2:大图)
		Integer bannerImageType = null;
		
		List<BannerImage> bannerImages = bannerShowService.getBannerList(bannerShowType, bannerImageType);
		
		//把返回信息封装为json
		String jsonp = super.getResJsonp(bannerImages);
		super.write(jsonp);
				
		return null;
	}
	
	/**
	 * @Title: getBannerInfo
	 * @Description: 获取Banner详情
	 * @author yuHaiQing
	 * @return String    响应数据
	 */
	public String getBannerInfo(){
		
		//banner主键Id
		String bannerImageId = null;
		
		BannerImage bannerImage = bannerShowService.getBannerInfo(bannerImageId);
		
		//把返回信息封装为json
		String jsonp = super.getResJsonp(bannerImage);
		super.write(jsonp);
		
		return null;
	}
	
}
